Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine(v3.7.x): refine bootctrl.common CMDHelperFuncs #289

Merged
merged 29 commits into from
Apr 25, 2024

Conversation

Bodong-Yang
Copy link
Member

@Bodong-Yang Bodong-Yang commented Apr 21, 2024

Description

Warning

For convenience, this PR remove the cboot boot control implementation as cboot boot controller is fully refactored in #287 .

This PR does the following things:

  1. refines the common module's subprocess wrapper methods.
  2. refines and simplify the boot_control.common.CMDHelperFuncs implementation a lot.
  3. cleanup and remove boot_contro.errors, now each boot controller implementation has their own error types.
  4. use mount slot helper's prepare_standby_dev instead of each boot controller's prepare_standby_dev method.

Other changes are integrating the new CMDHelperFuncs to each boot controller and fix up test files accordingly.

Bug fixed

This PR also fixes a problem of rpi_boot device respond an empty OTA progress to status API call before device reboots. This is caused by rpi_boot implementation directly call reboot with subprocess without using the correct CMDHelperFunc reboot method.

Check list

  • test file(s) that covers the change(s) is implemented.
  • local test is passed.
  • VM test passed.
  • real ECU test passed.

Behavior changes

Does this PR introduce behavior change(s)?

  • No.

Breaking change

Does this PR introduce breaking change?

  • No.

Related links & tickets

@Bodong-Yang Bodong-Yang changed the base branch from main to v3.7.x April 21, 2024 13:20
Copy link
Contributor

github-actions bot commented Apr 21, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
otaclient/app
   __init__.py00100% 
   __main__.py330%16–19
   common.py3843990%63, 143, 249, 252–254, 269, 276–278, 344–346, 356, 365–367, 473, 485, 604–608, 696, 698, 730–732, 734, 760–763, 768, 772–776, 802–803
   configs.py760100% 
   downloader.py2714484%68, 81–82, 297, 302, 306, 324–325, 375–379, 398–408, 429–447, 456, 531–533, 549, 569–587
   errors.py1130100% 
   interface.py17476%32, 43, 47, 51
   log_setting.py55787%39–40, 52, 54, 65–67
   main.py29293%43–44
   ota_client.py39814963%55–56, 76, 182–206, 243–246, 258–274, 284–287, 292–330, 372–375, 380–387, 400–423, 429–432, 461–485, 499–506, 513, 516–522, 569–572, 580, 616, 621–643, 703–719, 730–746, 757, 776, 787–788, 805, 824, 828–829, 844
   ota_client_call.py38684%42–44, 80–82
   ota_client_service.py27389%55–57
   ota_client_stub.py39110972%76–81, 89–97, 101–130, 135–144, 147–154, 162–167, 204–206, 211, 247, 272, 275, 278, 382, 408, 410, 436, 486, 543, 613–614, 653, 672–683, 687–701, 705–708, 761, 848–857, 887–934, 937
   ota_metadata.py3153190%145, 150, 186–187, 197–201, 213, 271, 304–306, 323–326, 406, 409, 417–419, 432, 441–446, 719–730
   ota_status.py14286%34, 42
   update_stats.py105298%160, 170
otaclient/app/boot_control
   __init__.py40100% 
   _common.py2357867%72–73, 94–96, 112–113, 133–134, 153–154, 173–174, 193–194, 209–210, 231–239, 257–265, 284–289, 312–338, 357–376, 392–401, 494–504, 563–564, 618, 622–623, 626, 634–637, 711–712, 722, 740
   _grub.py42112969%217, 265–268, 274–278, 315–316, 323–354, 363–376, 385–391, 470–476, 528, 534, 560, 582–587, 602–604, 628–631, 643–653, 712–715, 740–743, 766–769, 781–786, 821, 827, 847–850, 862, 865, 868, 871, 875–877, 895–898, 926–929, 934–942, 947–955
   _rpi_boot.py25912253%84–86, 92–152, 176–178, 184–186, 199–201, 207–209, 222–247, 252, 256, 260, 264, 298, 325–327, 337–340, 344–350, 390–392, 434–438, 457–460, 465, 468, 492–495, 500–508, 513–521, 535–538, 544–546, 549
   configs.py420100% 
   firmware.py31777%54–55, 60, 62, 73–75
   protocol.py28582%53, 57, 61, 65, 73
   selecter.py352334%43–68, 76–89
otaclient/app/create_standby
   __init__.py12558%28–34
   common.py2164579%72, 75–76, 80–93, 139, 187–195, 198–201, 205, 216, 290–298, 310, 354–359, 375–376, 390–394, 419–420
   interface.py19384%55, 59, 63
   rebuild_mode.py89199%104
otaclient/app/proto
   __init__.py31390%37, 44–45
   _common.py4194988%85, 163, 170, 182–184, 203, 208, 219, 256, 262, 267, 298, 302, 306, 363, 380, 403, 464, 471, 474, 494, 501, 503, 529, 535, 538, 540, 565, 571, 574, 576, 605, 609, 611, 625, 642, 670, 673, 677, 680, 708, 714, 761–766, 797
   _ota_metafiles_wrapper.py841385%37, 40–42, 112–116, 122–125
   _otaclient_v2_pb2_wrapper.py2763787%87, 90–93, 132, 175, 183, 197, 207, 210–213, 258, 261, 264–265, 285, 305, 385, 452, 505, 513–515, 519–522, 525–530, 551, 559, 573, 581, 595
   streamer.py43881%32, 47, 65–66, 71, 80–81, 99
   wrapper.py40100% 
otaclient/ota_proxy
   __init__.py46393%86, 90, 94
   __main__.py22220%16–79
   _consts.py150100% 
   cache_control.py68494%71, 91, 113, 121
   config.py180100% 
   db.py1461590%75, 81, 103, 113–116, 145–147, 166, 199, 208–209, 229, 258, 300
   errors.py100100% 
   orm.py1151190%37, 91, 96, 101, 107, 113, 140–141, 154, 231, 235
   ota_cache.py4047581%95–96, 215, 226, 253–255, 275, 291–294, 317–330, 359–363, 379, 440–441, 483–484, 554, 567–570, 620, 639–640, 672–673, 684, 721–728, 735–736, 741–743, 747, 756, 803, 811–813, 892–895, 899–903, 917–934, 965, 971, 998, 1027–1029
   server_app.py1383972%75, 78, 84, 100, 102, 161–170, 212–243, 256–266, 292–298, 312–314, 320–322
   utils.py23196%31
TOTAL5489109980% 

@Bodong-Yang Bodong-Yang self-assigned this Apr 24, 2024
@Bodong-Yang Bodong-Yang added the refinement Improve the performance, code quality(like improving code structure/readability/error handling/robus label Apr 24, 2024
@Bodong-Yang Bodong-Yang marked this pull request as ready for review April 25, 2024 02:17
@Bodong-Yang Bodong-Yang merged commit 727ebdd into v3.7.x Apr 25, 2024
3 checks passed
@Bodong-Yang Bodong-Yang deleted the refine/v3.7.x/bootctrl_cmdhelper branch April 25, 2024 03:03
Bodong-Yang added a commit to Bodong-Yang/ota-client that referenced this pull request Apr 25, 2024
commit 727ebdd
Author: Bodong Yang <[email protected]>
Date:   Thu Apr 25 12:03:09 2024 +0900

    refine(v3.7.x): refine bootctrl.common CMDHelperFuncs (tier4#289)

    This PR does the following things:
    1. refines the common module's subprocess wrapper methods.
    2. refines and simplify the boot_control.common.CMDHelperFuncs implementation a lot.
    3. cleanup and remove boot_contro.errors, now each boot controller implementation has their own error types.
    4. use mount slot helper's prepare_standby_dev instead of each boot controller's prepare_standby_dev method.
    5. integrate the new CMDHelperFuncs to each boot controller and fix up test files accordingly.

    NOTE that cboot boot controller implementation is temporarily removed, it will be added back in tier4#287 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refinement Improve the performance, code quality(like improving code structure/readability/error handling/robus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant